home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / shells / zsh-3.000 / zsh-3 / home / ftp / pub / local / info / zsh.info-4 (.txt) < prev    next >
GNU Info File  |  1996-07-16  |  49KB  |  969 lines

  1. This is Info file zsh.info, produced by Makeinfo-1.63 from the input
  2. file ./zsh.texi.
  3. This is a texinfo version of the man page for the Z Shell, originally by
  4. Paul Falstad.  It was converted from the `zsh.1' file distributed with
  5. zsh v2.5.0 by Jonathan Hardwick, `jch@cs.cmu.edu' and updated/modified
  6. by Clive Messer, `clive@epos.demon.co.uk' to it's present state.
  7. File: zsh.info,  Node: Shell Builtin Commands,  Next: Programmable Completion,  Prev: Options,  Up: Top
  8. Shell Builtin Commands
  9. **********************
  10. `- simple command'
  11.      *Note Precommand Modifiers::.
  12. `. FILE [ ARG ... ]'
  13.      Read and execute commands from FILE and execute them in the
  14.      current shell environment.  If FILE does not contain a slash, or if
  15.      `PATH_DIRS' is set, the shell looks in the components of `path' to
  16.      find the directory containing FILE.  Files in the current
  17.      directory are not read unless `.' appears somewhere in `path'.  If
  18.      any arguments ARG are given, they become the positional
  19.      parameters; the old positional parameters are restored when the
  20.      FILE is done executing.  The exit status is the exit status of the
  21.      last command executed.
  22. `: [ ARG ... ]'
  23.      This command only expands parameters.  A zero exit code is
  24.      returned.
  25. `alias [ -grmL ] [ NAME[=VALUE] ] ...'
  26.      For each NAME with a corresponding VALUE, define an alias with that
  27.      value.  A trailing space in VALUE causes the next word to be
  28.      checked for alias substitution.  If the `-g' flag is present,
  29.      define a global alias; global aliases are expanded even if they do
  30.      not occur in command position.  For each NAME with no VALUE, print
  31.      the value of NAME, if any.  With no arguments, print all currently
  32.      defined aliases.  If the `-m' flag is given the arguments are
  33.      taken as patterns (they should be quoted to preserve them from
  34.      being interpreted as glob patterns) and the aliases matching these
  35.      patterns are printed.  When printing aliases and the `-g' or `-r'
  36.      flags are present, then restrict the printing to global or regular
  37.      aliases, respectively.  If the `-L' flag is present, then print
  38.      each alias in a manner suitable for putting in a startup script.
  39.      The exit status is nonzero if a NAME (with no VALUE) is given for
  40.      which no alias has been defined.
  41. `autoload [ NAME ... ]'
  42.      For each of the NAMEs (which are names of functions), create a
  43.      function marked undefined.  The `fpath' variable will be searched
  44.      to find the actual function definition when the function is first
  45.      referenced.  The definition is contained in a file of the same
  46.      name as the function.  If the file found contains a standard
  47.      definition for the function, that is stored as the function;
  48.      otherwise, the contents of the entire file are stored as the
  49.      function.  The latter format allows functions to be used directly
  50.      as scripts.
  51. `bg [ JOB ... ]'
  52. `JOB ... &'
  53.      Put each specified JOB in the background, or the current job if
  54.      none is specified. *Note Jobs & Signals::.
  55. `bindkey -mevd'
  56. `bindkey -r IN-STRING ...'
  57. `bindkey [ -a ] IN-STRING [ COMMAND ] ...'
  58. `bindkey -s [ -a ] IN-STRING OUT-STRING ...'
  59.      The `-e' and `-v' options put the keymaps in emacs mode and vi
  60.      mode respectively; they cannot be used simultaneously.  The `-d'
  61.      option resets all bindings to the compiled-in settings.  If not
  62.      used with options `-e' or `-v', the maps will be left in emacs
  63.      mode, or in vi mode if the `VISUAL' or `EDITOR' variables contain
  64.      the string `vi'.  Metafied characters are bound to self-insert by
  65.      default.  The `-m' option loads the compiled-in bindings of these
  66.      characters for the mode determined by the preceding options, or
  67.      the current mode if used alone.  Any previous binding done by the
  68.      user will be preserved.  If the `-r' option is given, remove any
  69.      binding for each IN-STRING.  If the `-s' option is not specified,
  70.      bind each IN-STRING to a specified COMMAND.  If no COMMAND is
  71.      specified, print the binding of IN-STRING if it is bound, or
  72.      return a nonzero exit code if it is not bound.  If the `-s' option
  73.      is specified, bind each IN-STRING to each specified OUT-STRING.
  74.      When IN-STRING is typed, OUT-STRING will be pushed back and
  75.      treated as input to the line editor.  The process is recursive,
  76.      but to avoid infinite loops the shell will report an error if more
  77.      than 20 consecutive replacements happen.  If the `-a' option is
  78.      specified, bind the IN-STRINGs in the alternative keymap instead
  79.      of the standard one.  The alternative keymap is used in vi command
  80.      mode.
  81.      It's possible for an IN-STRING to be bound to something and also
  82.      be the beginning of a longer bound string.  In this case the shell
  83.      will wait a certain time to see if more characters are typed, and
  84.      if not it will execute the binding.  This timeout is defined by the
  85.      `KEYTIMEOUT' parameter; the default is 0.4 seconds.  No timeout is
  86.      done if the prefix string is not bound.
  87.      For either IN-STRING or OUT-STRING, control characters may be
  88.      specified in the form `^X', and the backslash may be used to
  89.      introduce one of the following escape sequences:
  90.     `\a'
  91.           Bell character
  92.     `\n'
  93.           Linefeed (newline)
  94.     `\b'
  95.           Backspace
  96.     `\t'
  97.           Horizontal tab
  98.     `\v'
  99.           Vertical tab
  100.     `\f'
  101.           Form feed
  102.     `\r'
  103.           Carriage return
  104.     `\e'
  105.     `\E'
  106.           Escape
  107.     `\NNN'
  108.           Character code in octal
  109.     `\xNN'
  110.           Character code in hexadecimal
  111.     `\M-XXX'
  112.           Character or escape sequence with meta bit set.  The `-'
  113.           after the `M' is optional.
  114.     `\C-X'
  115.           Control character.  The `-' after the `M' is optional.
  116.      In all other cases, `\' escapes the following character.  Delete is
  117.      written as `^?'.  Note that `\M^?' and `^\M?' are not the same.
  118.      Multi-character IN-STRINGS cannot contain the null character (`^@'
  119.      or `^ ').  If they appear in a bindkey command, they will be
  120.      silently translated to `\M-^@'.  This restriction does not apply
  121.      to OUT-STRINGS, single-character IN-STRINGS and the first
  122.      character of a multi-char IN-STRING.
  123. `break [ N ]'
  124.      Exit from an enclosing `for', `while', `until', `select', or
  125.      `repeat' loop.  If N is specified, then break N levels instead of
  126.      just one.
  127. `builtin NAME [ ARGS ] ...'
  128.      Executes the builtin NAME, with the given ARGS.
  129. `bye'
  130.      Same as `exit'.
  131. `cd [ ARG ]'
  132. `cd OLD NEW'
  133. `cd [+-]n'
  134.      Change the current directory.  In the first form, change the
  135.      current directory to ARG, or to the value of `HOME' if ARG is not
  136.      specified.  If ARG is `-', change to the value of `OLDPWD', the
  137.      previous directory.  If a directory named ARG is not found in the
  138.      current directory and ARG does not begin with a slash, search each
  139.      component of the shell parameter `cdpath'.  If the option
  140.      `CDABLEVARS' is set, and a parameter named ARG exists whose value
  141.      begins with a slash, treat its value as the directory.
  142.      The second form of `cd' substitutes the string NEW for the string
  143.      OLD in the name of the current directory, and tries to change to
  144.      this new directory.
  145.      The third form of `cd' extracts an entry from the directory stack,
  146.      and changes to that directory.  An argument of the form `+N'
  147.      identifies a stack entry by counting from the left of the list
  148.      shown by the `dirs' command, starting with zero.  An argument of
  149.      the form `-N' counts from the right.  If the `PUSHD_MINUS' option
  150.      is set, the meanings of `+' and `-' in this context are swapped.
  151. `chdir'
  152.      Same as `cd'.
  153. `command simple command'
  154.      *Note Precommand Modifiers::.
  155. `compctl'
  156.      *Note Programmable Completion::.
  157. `continue [ NUM ]'
  158.      Resume the next iteration of the enclosing `for', `while',
  159.      `until', `select', or `repeat' loop.  If N is specified, break out
  160.      of N-1 loops and resume at the N'th enclosing loop.
  161. `declare [ ARG ... ]'
  162.      Same as `typeset'.
  163. `dirs [ -v ] [ ARG ... ]'
  164.      With no arguments, print the contents of the directory stack.  If
  165.      the `-v' option is given, number the directories in the stack when
  166.      printing.  Directories are added to this stack with the `pushd'
  167.      command, and removed with the `cd' or `popd' commands.  If
  168.      arguments are specified, load them onto the directory stack,
  169.      replacing anything that was there, and push the current directory
  170.      onto the stack.
  171. `disable [ -afmr ] ARG ...'
  172.      Disable the hash table element named ARG temporarily.  The default
  173.      is to disable builtin commands.  This allows you to use an
  174.      external command with the same name as a builtin command.  The
  175.      `-a' option causes `disable' to act on aliases.  The `-f' option
  176.      causes `disable' to act on shell functions.  The `-r' option
  177.      causes `disable' to act on reserved words.  Without arguments all
  178.      disabled hash table elements from the corresponding hash table are
  179.      printed.  With the `-m' flag the arguments are taken as patterns
  180.      (which should be quoted to preserve them from being taken as glob
  181.      patterns) and all hash table elements from the corresponding hash
  182.      table matching these patterns are disabled.  Disabled objects can
  183.      be enabled with the `enable' command.
  184. `disown [ JOB ... ]'
  185. `job ... &|'
  186. `job ... &!'
  187.      Remove the specified jobs from the job table; the shell will no
  188.      longer report their status, and will not complain if you try to
  189.      exit an interactive shell with them running or stopped.  If no
  190.      `job' is specified use the current `job'.
  191. `echo [ -neE ] [ ARG ... ]'
  192.      Write each ARG on the standard output, with a space separating
  193.      each one.  If the `-n' flag is not present, print a newline at the
  194.      end.  `echo' recognizes the following escape sequences:
  195.     `\a'
  196.           Bell
  197.     `\b'
  198.           Backspace
  199.     `\c'
  200.           Don't print an ending newline
  201.     `\e'
  202.           Escape
  203.     `\f'
  204.           Form feed
  205.     `\n'
  206.           Newline
  207.     `\r'
  208.           Carriage return
  209.     `\t'
  210.           Horizontal tab
  211.     `\v'
  212.           Vertical tab
  213.     `\\'
  214.           Backslash
  215.     `\0NNN'
  216.           Character code in octal, with a maximum of three digits after
  217.           the zero.  A non-octal digit terminates the number.
  218.     `\xNN'
  219.           Character code in hexadecimal, with a maximum of two digits
  220.           after the `x'.  A non-hexadecimal digit terminates the number.
  221.      The `-E' flag or the `BSD_ECHO' option can be used to disable
  222.      these escape sequences.  In the later case `-e' flag can be used
  223.      to enable them.
  224. `echotc CAP [ ARG ... ]'
  225.      Output the termcap string corresponding to the capability CAP,
  226.      with optional arguments.
  227. `emulate [ SH | KSH | CSH ]'
  228.      Set the current emulation mode to the specified shell.  This
  229.      affects the meaning of single letter options to builtins such as
  230.      `set' and the value of `$-'.  This command also sets compatibility
  231.      options to emulate the specified shell.  csh will never be fully
  232.      emulated.  If the argument is not one of the shells listed above,
  233.      zsh will be used as a default.
  234. `enable [ -afmr ] ARG ...'
  235.      Enable the hash table element named ARG, presumably disabled
  236.      earlier with `disable'.  The default is to enable builtin
  237.      commands.  The `-a' option causes `enable' to act on aliases.  The
  238.      `-f' option causes `enable' to act on shell functions.  The `-r'
  239.      option causes `enable' to act on reserved words.  Without
  240.      arguments all enable hash table elements from the corresponding
  241.      hash table are printed.  With the `-m' flag the arguments are
  242.      taken as patterns (should be quoted) and all hash table elements
  243.      from the corresponding hash table matching these patterns are
  244.      enabled.  Enabled objects can be disabled with the `disable'
  245.      builtin command.
  246. `eval [ ARG ... ]'
  247.      Read the arguments as input to the shell and execute the resulting
  248.      command(s) in the current shell process.
  249. `exec simple command'
  250.      *Note Precommand Modifiers::.
  251. `exit [ N ]'
  252.      Exit the shell with the exit code specified by N; if none is
  253.      specified, use the exit code from the last command executed.  An
  254.      `EOF' condition will also cause the shell to exit, unless the
  255.      `IGNORE_EOF' option is set.
  256. `export [ NAME[=VALUE] ... ]'
  257.      The specified NAMEs are marked for automatic export to the
  258.      environment of subsequently executed commands.  `export' is
  259.      equivalent to `typeset -x'.
  260. `false'
  261.      Do nothing and return an exit code of 1.
  262. `fc [ -e ENAME ] [ -nlrdDfEim ] [ OLD=NEW ... ] [ FIRST [ LAST ]]'
  263. `fc -ARWI [ FILENAME ]'
  264.      Select a range of commands from FIRST to LAST from the history
  265.      list.  The arguments FIRST and LAST may be specified as a number
  266.      or as a string.  A negative number is used as an offset to the
  267.      current history event number.  A string specifies the most recent
  268.      event beginning with the given string.  All substitutions OLD=NEW,
  269.      if any, are then performed on the commands.  If the `-l' flag is
  270.      given, the resulting commands are listed on standard output.  If
  271.      the `-m' flag is also given the first argument is taken as a
  272.      pattern (which should be quoted), and only the history events
  273.      matching this pattern will be shown.  Otherwise the editor program
  274.      ENAME is invoked on a file containing these history events.  If
  275.      ENAME is not given, the value of the parameter `FCEDIT' is used.
  276.      If ENAME is `-', no editor is invoked.  When editing is complete,
  277.      the edited command(s) is executed.  If FIRST is not specified, it
  278.      will be set to -1 (the most recent event), or to -16 if the `-l'
  279.      flag is given.  If LAST is not specified, it will be set to FIRST,
  280.      or to -1 if the `-l' flag is given.  The flag `-r' reverses the
  281.      order of the commands and the flag `-n' suppresses command numbers
  282.      when listing.  Also when listing, `-d' prints timestamps for each
  283.      command, `-f' prints full time and date stamps. Adding the `-E'
  284.      flag causes the dates to be printed as (`dd.mm.yyyy'), instead of
  285.      the default, `mm/dd/yyyy'.  Adding the `-i' flag causes the dates
  286.      to be printed as `yyyy-mm-dd', in a fixed format.  With the `-D'
  287.      flag, `fc' prints elapsed times.
  288.      `fc -R' reads the history from the given file, `fc -W' writes the
  289.      history out to the given file, and `fc -A' appends the history out
  290.      to the given file. `fc -AI' (`WI') appends (writes) only those
  291.      events that are new since the last incremental append (write) to
  292.      the history file.  In any case the file will have no more than
  293.      `SAVEHIST' entries.
  294. `fg [ JOB ... ]'
  295. `JOB ...'
  296.      Bring the specified JOBs to the foreground.  If no JOB is
  297.      specified, use the current job.
  298. `functions [ +-tum ] [ NAME ... ]'
  299.      Equivalent to `typeset -f'.
  300. `getln NAME ...'
  301.      Read the top value from the buffer stack and put it in the shell
  302.      parameter NAME.  Equivalent to `read -zr'.  The flags `-c', `-l',
  303.      `-A', `-e', `-E', and `-n' are also supported.
  304. `getopts OPTSTRING NAME [ ARG ... ]'
  305.      Checks ARG for legal options.  If ARG is omitted, use the
  306.      positional parameters.  A valid option argument begins with a `+'
  307.      or a `-'.  An argument not beginning with a `+' or a `-', or the
  308.      argument `--', ends the options.  OPTSTRING contains the letters
  309.      that `getopts' recognizes.  If a letter is followed by a `:', that
  310.      option is expected to have an argument.  The options can be
  311.      separated from the argument by blanks.
  312.      Each time it is invoked, `getopts' places the option letter it
  313.      finds in the shell parameter NAME, prepended with a `+' when ARG
  314.      begins with a `+'.  The index of the next ARG is stored in
  315.      `OPTIND'.  The option argument, if any, is stored in `OPTARG'.
  316.      A leading `:' in OPTSTRING causes `getopts' to store the letter of
  317.      the invalid option in `OPTARG', and to set NAME to `?' for an
  318.      unknown option and to `:' when a required option is missing.
  319.      Otherwise, `getopts' prints an error message.  The exit status is
  320.      nonzero when there are no more options.
  321. `hash [ -dfmr ] [ NAME[=VALUE ] ] ...'
  322.      With no arguments or options, `hash' will list the entire command
  323.      hash table.
  324.      The `-m' option causes the arguments to be taken as patterns (they
  325.      should be quoted) and the elements of the command hash table
  326.      matching these patterns are printed.
  327.      The `-r' option causes the command hash table to be thrown out and
  328.      restarted.  The `-f' option causes the entire path to be searched,
  329.      and all the commands found are added to the hash table.  These
  330.      options cannot be used with any arguments.
  331.      For each NAME with a corresponding VALUE, put NAME in the command
  332.      hash table, associating it with the pathname VALUE.  Whenever NAME
  333.      is used as a command argument, the shell will try to execute the
  334.      file given by VALUE.  For each NAME with no corresponding VALUE,
  335.      search for NAME in the path, and add it to the command hash table,
  336.      and associating it with the discovered path, if it is found.
  337.      Adding the `-d' option causes `hash' to act on the named directory
  338.      table instead of the command hash table.  The remaining discussion
  339.      of `hash' will assume that the `-d' is given.
  340.      If invoked without any arguments, and without any other options,
  341.      `hash -d' lists the entire named directory table.
  342.      The `-m' option causes the arguments to be taken as patterns (they
  343.      should be quoted) and the elements of the named directory table
  344.      matching these patterns are printed.
  345.      The `-r' option causes the named directory table to be thrown out
  346.      and restarted so that it only contains  `~'.  The `-f' option
  347.      causes all usernames to be added to the named directory table.
  348.      These options cannot be used with any arguments.
  349.      For each NAME with a corresponding VALUE, put NAME in the named
  350.      directory table.  The directory name NAME is then associated with
  351.      the specified path VALUE, so that VALUE may be referred to as
  352.      `~NAME'.  For each NAME with no corresponding VALUE, search for as
  353.      a username and as a parameter.  If it is found, it is added to the
  354.      named directory hash table.
  355. `history [ -nrdDfEim ] [ FIRST [ LAST ]]'
  356.      Same as `fc -l'.
  357. `integer [ +-lrtux ] [ NAME[=VALUE] ]'
  358.      Same as `typeset -i', except that options irrelevant to integers
  359.      are not permitted.
  360. `jobs [ -lprs ] [ JOB ... ]'
  361.      Lists information about each given job, or all jobs if JOB is
  362.      omitted.  The `-l' flag lists process ids, and the `-p' flag lists
  363.      process groups.  If the `-r' flag is given only running jobs will
  364.      be listed; if the `-s' flag is given only stopped jobs are shown.
  365. `kill [ -s SIGNAL_NAME ] JOB ...'
  366. `kill [ -SIG ] JOB ...'
  367. `kill -l [ SIG ... ]'
  368.      Sends either `SIGTERM' or the specified signal to the given jobs or
  369.      processes.  Signals are given by number or by names, without the
  370.      `SIG' prefix.  If the signal being sent is not `KILL' or `CONT',
  371.      then the job will be sent a `CONT' signal if it is stopped.  The
  372.      argument JOB can be the process id of a job not in the job list.
  373.      In the third form, `kill -l', if SIG is not specified the signal
  374.      names are listed.  Otherwise, for each SIG that is a name, the
  375.      corresponding signal number is listed.  For each SIG that is a
  376.      signal number or a number representing the exit status of a
  377.      process which was terminated or stopped by a signal the name of
  378.      the signal is printed.
  379. `let ARG ...'
  380.      Evaluate each ARG as an arithmetic expression.  *Note Arithmetic
  381.      Evaluation::, for a description of arithmetic expressions.  The
  382.      exit status is 0 if the value of the last expression is nonzero,
  383.      and 1 otherwise.
  384. `limit [ -hs ] [ RESOURCE [ LIMIT ] ] ...'
  385.      Set or display resource limits.  Unless the `-s' flag is given the
  386.      limit applies only the children of the shell.  If `-s' is given
  387.      without other arguments, the resource limits of the current shell
  388.      is set to the previously set resource limits of the children.  If
  389.      LIMIT is not specified, print the current limit placed on
  390.      RESOURCE; otherwise set the limit to the specified value.  If the
  391.      `-h' flag is given, use hard limits instead of soft limits.  If no
  392.      RESOURCE is given, print all limits.
  393.      RESOURCE is one of:
  394.     `cputime'
  395.           Maximum CPU seconds per process.
  396.     `filesize'
  397.           Largest single file allowed.
  398.     `datasize'
  399.           Maximum data size (including stack) for each process.
  400.     `stacksize'
  401.           Maximum stack size for each process.
  402.     `coredumpsize'
  403.           Maximum size of a core dump.
  404.     `resident'
  405.     `memoryuse'
  406.           Maximum resident set size.
  407.     `memorylocked'
  408.           Maximum amount of memory locked in RAM.
  409.     `descriptors'
  410.           Maximum value for a file descriptor.
  411.     `openfiles'
  412.           Maximum number of open files.
  413.     `vmemorysize'
  414.           Maximum amount of virtual memory.
  415.      Which of these resource limits are available depends on the system.
  416.      LIMIT is a number, with an optional scaling factor, as follows:
  417.     `Nh'
  418.           Hours.
  419.     `Nk'
  420.           Kilobytes.  This is the default for all but cputime.
  421.     `Nm'
  422.           Megabytes or minutes.
  423.     `MM:SS'
  424.           Minutes and seconds.
  425. `local [ +-LRZilrtu [N]] [ NAME[=VALUE] ]'
  426.      Same as `typeset', except that the options `-x' and `-f' are not
  427.      permitted.
  428. `log'
  429.      List all users currently logged in who are affected by the current
  430.      setting of the `watch' parameter.
  431. `logout'
  432.      Exit the shell, if this is a login shell.
  433. `noglob simple command'
  434.      *Note Precommand Modifiers::.
  435. `popd [ +-N ]'
  436.      Removes a entry from the directory stack and, performs a `cd' to
  437.      the new top directory.  With no argument, the current top entry is
  438.      removed.  An argument of the form `+N' identifies a stack entry by
  439.      counting from the left of the list shown by the `dirs' command,
  440.      starting with zero.  An argument of the form `-n' counts from the
  441.      right.  If the `PUSHD_MINUS' option is set, the meanings of `+'
  442.      and `-' in this context are swapped.
  443. `print [ -nrslzpNDPoOicm ] [ -uN ] [ -R [ -en ]] [ ARG ... ]'
  444.      With no flags or with flag `-', the arguments are printed on the
  445.      standard output as described by `echo', with the following
  446.      differences: the escape sequence `\M-x' metafies the character `x'
  447.      (sets the highest bit), `\C-x' produces a control character
  448.      (`\C-@' and `\C-?' give the characters NULL and delete) and `\E'
  449.      is a synonym for `\e'.  Finally, if not in an escape sequence, `\'
  450.      escapes the following character and is not printed.
  451.     `-r'
  452.           Ignore the escape conventions of `echo'.
  453.     `-R'
  454.           Emulate the BSD `echo' command which does not process escape
  455.           sequences unless the `-e' flag is given.  The `-n' flag
  456.           suppresses the trailing newline.  Only the `-e' and `-n'
  457.           flags are recognized after `-R', all other arguments and
  458.           options are printed.
  459.     `-m'
  460.           Take the fist argument as a pattern (should be  quoted) and
  461.           remove it from the argument list together with subsequent
  462.           arguments that do not match this pattern.
  463.     `-s'
  464.           Place the results in the history list instead of on the
  465.           standard output.
  466.     `-n'
  467.           Do not add a newline to the output.
  468.     `-l'
  469.           Print the arguments separated by newlines instead of spaces.
  470.     `-N'
  471.           Print the arguments separated and terminated by nulls.
  472.     `-o'
  473.           Print the arguments sorted in ascending order.
  474.     `-O'
  475.           Print the arguments sorted in descending order.
  476.     `-i'
  477.           If given together with `-o' or `-O', makes the sort be
  478.           case-insensitive.
  479.     `-c'
  480.           Print the arguments in columns.
  481.     `-uN'
  482.           Print the arguments to file descriptor N.
  483.     `-p'
  484.           Print the arguments to the input of the coprocess.
  485.     `-z'
  486.           Push the arguments onto the editing buffer stack, separated
  487.           by spaces; no escape sequences are recognized.
  488.     `-D'
  489.           Treat the arguments as directory names, replacing prefixes
  490.           with `~' expressions, as appropriate.
  491.     `-P'
  492.           Recognize the same escape sequences as in the `PROMPT'
  493.           parameter.
  494. `pushd [ ARG ]'
  495. `pushd OLD NEW'
  496. `pushd +-N'
  497.      Change the current directory, and push the old current directory
  498.      onto the directory stack.  In the first form, change the current
  499.      directory to ARG.  If ARG is not specified, change to the second
  500.      directory on the stack (that is, exchange the top two entries), or
  501.      change to the value of `HOME' if the `PUSHD_TO_HOME' option is set
  502.      or if there is only one entry on the stack.  If ARG is `-', change
  503.      to the value of `OLDPWD', the previous directory.  If a directory
  504.      named ARG is not found in the current directory and ARG does not
  505.      contain a slash, search each component of the shell parameter
  506.      `cdpath'.  If the option `CDABLEVARS' is set, and a parameter
  507.      named ARG exists whose value begins with a slash, treat its value
  508.      as the directory.  If the option `PUSHD_SILENT' is not set, the
  509.      directory stack will be printed after a `pushd' is performed.
  510.      The second form of `pushd' substitutes the string NEW for the
  511.      string OLD in the name of the current directory, and tries to
  512.      change to this new directory.
  513.      The third form of `pushd' changes directory by rotating the
  514.      directory list.  An argument of the form `+n' identifies a stack
  515.      entry by counting from the left of the list shown by the `dirs'
  516.      command, starting with zero.  An argument of the form `-n' counts
  517.      from the right.  If the `PUSHD_MINUS' option is set, the meanings
  518.      of `+' and `-' in this context are swapped.
  519. `pushln'
  520.      Equivalent to `print -nz'.
  521. `pwd [ -r ]'
  522.      Print the absolute pathname of the current working directory.  If
  523.      the `-r' flag is specified or the `CHASE_LINKS' option is set, the
  524.      printed path will not contain symbolic links.
  525.      Equivalent to `fc -e -'.
  526. `read [ -rzpqAclneE ] [ -k [NUM] ] [ -uN ] [ NAME?PROMPT ] [ NAME ... ]'
  527.      Read one line and break it into fields using the characters in
  528.      `IFS' as separators.
  529.     `-r'
  530.           Raw mode: a `\' at the end of a line does not signify line
  531.           continuation.
  532.     `-q'
  533.           Read only one character from the terminal and set NAME to `y'
  534.           if this character was `y' or `Y' and to `n' otherwise.  With
  535.           this flag set the return value is zero only if the character
  536.           was `y' or `Y'.
  537.     `-k [ NUM ]'
  538.           Read only one (or NUM) characters from the terminal.
  539.     `-z'
  540.           Read from the editor buffer stack.  The first field is
  541.           assigned to the first NAME, the second field to the second
  542.           NAME,  etc., with leftover fields assigned to the last NAME.
  543.     `-e'
  544.     `-E'
  545.           The words read are printed after the whole line is read.  If
  546.           the `-e' flag is set, the words are not assigned to the
  547.           parameters.
  548.     `-A'
  549.           The first NAME is taken as the name of an array and all words
  550.           are assigned to it.
  551.     `-c'
  552.     `-l'
  553.           These flags are allowed only if called inside a function used
  554.           for completion (specified with the `-K' flag to `compctl').
  555.           If the `-c' flag is given, the words of  the  current command
  556.           are  read. If the `-l' flag is given, the whole line is
  557.           assigned as a scalar.  If `name' is omitted then `REPLY' is
  558.           used for scalars and `reply' for arrays.
  559.     `-n'
  560.           Together with either of the previous flags, this option gives
  561.           the number of the word the cursor is on or the index of the
  562.           character the cursor is on respectively.
  563.     `-uN'
  564.           Input is read from file descriptor N.
  565.     `-p'
  566.           Input is read from the coprocess.
  567.      If the first argument contains a `?', the remainder of this word is
  568.      used as a `prompt' on standard error when the shell is
  569.      interactive.  The exit status is `0' unless an end-of-file is
  570.      encountered.
  571. `readonly [ NAME[=VALUE]] ...'
  572.      The given NAMES are marked readonly; these names cannot be changed
  573.      by subsequent assignment.
  574. `rehash [ -df ]'
  575.      Throw out the command hash table and start over.  If the `-f'
  576.      option is set, rescan the command path immediately, instead of
  577.      rebuilding the hash table incrementally.
  578.      The `-d' option causes `rehash' to act on the named directory table
  579.      instead of the command hash table.  This reduces the named
  580.      directory table to only the `~' entry.  If the `-f' option is also
  581.      used, the named directory table is rebuilt immediately.
  582.      `rehash' is equivalent to `hash -r'.
  583. `return [ N ]'
  584.      Causes a shell function or `.' script to return to the invoking
  585.      script with the return status specified by N.  If N is omitted
  586.      then the return status is that of the last command executed.
  587.      If `return' was executed from a trap, whether set by the `trap'
  588.      builtin or by defining a `TRAPXXX' function, the effect is
  589.      different for zero and non-zero return status.  With zero status
  590.      (or after an implicit return at the end of the trap), the shell
  591.      will return to whatever it was previously processing; with a
  592.      non-zero status, the shell will behave as interrupted except that
  593.      the return status of the trap is retained.  Note that the signal
  594.      which caused the trap is passed as the first argument, so the
  595.      statement `return $[128+$1]' will return the same status as if the
  596.      signal had not been trapped.
  597. `sched [+]HH:MM COMMAND ...'
  598. `sched [ -ITEM ]'
  599.      Make an entry in the scheduled list of commands to execute.  The
  600.      time may be specified in either absolute or relative time.  With no
  601.      arguments, prints the list of scheduled commands.  With the
  602.      argument `-ITEM', removes the given item from the list.
  603. `set [ +-OPTIONS ] [ +-o OPTION NAME ] ...'
  604. `set [ -A [NAME] ] [ ARG ] ...'
  605.      Set the options for the shell and/or set the positional
  606.      parameters, or declare an array.  *Note Options::, for the meaning
  607.      of the flags.  Flags may be specified by name using the `-o'
  608.      option.  If the `-A' flag is specified, NAME is set to an array
  609.      containing the given ARGs; if no NAME is specified, all arrays are
  610.      printed.  Otherwise the positional parameters are set.  If no
  611.      arguments are given, then the names and values of all parameters
  612.      are printed on the standard output.  If the only argument is `+',
  613.      the names of all parameters are printed.
  614. `setopt [ -m ] [ +-OPTIONS ] [ NAME ... ]'
  615.      Set the options for the shell.  All options specified either with
  616.      flags or by name are set.  If no arguments are supplied, the names
  617.      of all options currently set are printed.  In option names, case is
  618.      insignificant, and all underscore characters are ignored.  If the
  619.      `-m' flag is given the arguments are taken as patterns (which
  620.      should be quoted to preserve them from being interpreted as glob
  621.      patterns), and all options with names matching these patterns are
  622.      set.
  623. `shift [ N ] [ NAME ... ]'
  624.      The positional parameters from `$N+1' ... are renamed `$1', where
  625.      N is an arithmetic expression that defaults to 1.  If any NAMEs
  626.      are given then the arrays with these names are shifted, instead of
  627.      the positional parameters.
  628. `source'
  629.      Same as `.', except that the current directory is always searched
  630.      and is always searched first, before directories in `path'.
  631. `suspend [ -f ]'
  632.      Suspend the execution of the shell (send it a `SIGTSTP') until it
  633.      receives a `SIGCONT'.  If the `-f' option is not given, complain
  634.      if this is a login shell.
  635. `test ARG ...'
  636. `[ ARG ... ]'
  637.      Like the system version of `test'.  Added for compatibility; use
  638.      conditional expressions instead.
  639. `times'
  640.      Print the accumulated user and system times for the shell and for
  641.      processes run from the shell.
  642. `trap [ ARG ] [ SIG ] ...'
  643.      ARG is a command to be read and executed when the shell receives
  644.      SIG.  Each SIG can be given as a number or as the name of a
  645.      signal.  Inside the command, `$1' refers to the number of the
  646.      signal that caused the trap.  If ARG is `-', then all traps SIG
  647.      are reset to their default values.  If ARG is the null string,
  648.      then this signal is ignored by the shell and by the commands it
  649.      invokes.  If SIG is `ZERR' then ARG will be executed after each
  650.      command with a nonzero exit status.  If SIG is `DEBUG' then ARG
  651.      will be executed after each command. If SIG is `0' or `EXIT' and
  652.      the `trap' statement is executed inside the body of a function,
  653.      then the command ARG is executed after the function completes.  If
  654.      SIG is `0' or `EXIT' and the `trap' statement is not executed
  655.      inside the body of a function, then the command ARG is executed
  656.      when the shell terminates.  The `trap' command with no arguments
  657.      prints a list of commands associated with each signal.
  658. `true'
  659.      Do nothing and return an exit code of 0.
  660. `ttyctl [ -fu ]'
  661.      The `-f' option freezes the tty, and `-u' un-freezes it.  When the
  662.      tty is frozen, no changes made to the tty settings by external
  663.      programs will be honoured by the shell, except for changes in the
  664.      size of the screen; the shell will simply reset the settings to
  665.      their previous values as soon as each command exits.  Thus, `stty'
  666.      and similar programs have no effect when the tty is frozen.
  667.      Without options it reports whether the terminal is frozen or not.
  668. `type [ -fpam ] NAME ...'
  669.      Same as `whence -v'.
  670. `typeset [ +-LRUZfilrtuxm [N]] [ NAME[=VALUE]] ...'
  671.      Set attributes and values for shell parameters.  When invoked
  672.      inside a function, a new parameter is created which will be unset
  673.      when the function completes.  The new parameter will not be
  674.      exported unless `ALL_EXPORT' is set, in which case the parameter
  675.      will be exported provided no parameter of that name already
  676.      exists.  The following attributes are valid:
  677.     `-L'
  678.           Left justify and remove leading blanks from VALUE.  If N is
  679.           nonzero, it defines the width of the field; otherwise it is
  680.           determined by the width of the value of the first assignment.
  681.           When the parameter is printed, it is filled on the right
  682.           with blanks or truncated if necessary to fit the field.
  683.           Leading zeros are removed if the `-Z' flag is also set.
  684.     `-R'
  685.           Right justify and fill with leading blanks.  If N is nonzero
  686.           it defines the width of the field; otherwise it is determined
  687.           by the width of the value of the first assignment.  When the
  688.           parameter is printed, the field is left filled with blanks or
  689.           truncated from the end.
  690.     `-U'
  691.           For arrays keep only the first element of each duplications.
  692.           It can also be set for colon separated special parameters
  693.           like `PATH' or `FIGNORE', etc.
  694.     `-Z'
  695.           Right justify and fill with leading zeros if the first
  696.           non-blank character is a digit and the `-L' flag has not been
  697.           set.  If N is nonzero it defines the width of the field;
  698.           otherwise it is determined by the width of the value of the
  699.           first assignment.
  700.     `-f'
  701.           The names refer to functions rather than parameters.  No
  702.           assignments can be made, and the only other valid flags are
  703.           `-t' and `-u'.  The flag `-t' turns on execution tracing for
  704.           this function.  The flag `-u' causes this function to be
  705.           marked for autoloading.  The `fpath' parameter will be
  706.           searched to find the function definition when the function is
  707.           first referenced.; see `autoload'.
  708.     `-i'
  709.           Use an internal integer representation.  If N is nonzero it
  710.           defines the output arithmetic base, otherwise it is
  711.           determined by the first assignment.
  712.     `-l'
  713.           Convert to lower case.
  714.     `-r'
  715.           The given NAMEs are marked read-only.
  716.     `-t'
  717.           Tags the named parameters.  Tags have no special meaning to
  718.           the shell.
  719.     `-u'
  720.           Convert to upper case.
  721.     `-x'
  722.           Mark for automatic export to the environment of subsequently
  723.           executed commands.
  724.      Using `+' rather than `-' causes these flags to be turned off.  If
  725.      no arguments are given but flags are specified, a list of named
  726.      parameters which have these flags set is printed.  Using `+'
  727.      instead of `-' keeps their values from being printed.  If no
  728.      arguments or options are given, the names and attributes of all
  729.      parameters are printed.  If only the `-m' flag is given the
  730.      arguments are taken as patterns (which should be quoted), and all
  731.      parameters or functions (with the `-f' flag) with matching names
  732.      are printed.
  733. `ulimit [ -SHacdflmnpstv ] [ LIMIT ] ...'
  734.      Set or display resource limits of the shell and the processes
  735.      started by the shell.  The value of LIMIT can be a number in the
  736.      unit specified below or the value `unlimited'.  If the `-H' flag
  737.      is given use hard limits instead of soft limits.  If the `-S' flag
  738.      is given together with the `-H' flag set both hard and soft
  739.      limits.  If no options are used, the file size limit (`-f') is
  740.      assumed.  If LIMIT is omitted the current value of the specified
  741.      resources are printed.  When more than one resource values are
  742.      printed the limit name and unit is printed before each value.
  743.     `-a'
  744.           Lists all of the current resource limits.
  745.     `-c'
  746.           Maximum size of core dumps, in 512-byte blocks.
  747.     `-d'
  748.           Maximum size of the data segment, in Kbytes.
  749.     `-f'
  750.           Maximum size of individual files written, in 512-byte blocks.
  751.     `-l'
  752.           Maximum size of locked-in memory, in Kbytes.
  753.     `-m'
  754.           Maximum size of physical memory, in Kbytes.
  755.     `-n'
  756.           Maximum number of open file descriptors.
  757.     `-s'
  758.           Maximum size of stack, in Kbytes.
  759.     `-t'
  760.           Maximum number of CPU seconds.
  761.     `-u'
  762.           The number of processes available to the user.
  763.     `-v'
  764.           Maximum size of virtual memory, in Kbytes.
  765. `umask [ -S] [ MASK ]'
  766.      The umask is set to MASK.  MASK can be either an octal number or a
  767.      symbolic value as described in `chmod(1)'.  If MASK is omitted,
  768.      the current value is printed.  The `-S' option causes the mask to
  769.      be printed as a symbolic value.  Otherwise, the mask is printed as
  770.      an octal number.  Note that in the symbolic form the permissions
  771.      you specify are those which are to be allowed (not denied) to the
  772.      users specified).
  773. `unalias [ -m ] NAME ...'
  774.      The alias definition, if any, for each NAME is removed.  With the
  775.      `-m' flag, the arguments are taken as patterns (which should be
  776.      quoted), and all aliases with matching names are removed.
  777.      `unalias' is equivalent to `unhash -a'.
  778. `unfunction [ -m ] NAME ...'
  779.      The function definition, if any, for each NAME is removed.  With
  780.      the `-m' flag, the arguments are taken as patterns (which should be
  781.      quoted), and all function with matching names are removed.
  782.      `unfunction' is equivalent to `unhash -f'.
  783. `unhash [ -adfm ] NAME ...'
  784.      Remove the element named NAME from an internal hash table.  The
  785.      default is remove elements from the command hash table.  The `-a'
  786.      option causes `unhash' to remove aliases.  The `-f' option causes
  787.      `unhash' to remove shell functions.  The `-d' options causes
  788.      `unhash' to remove named directories.  If the `-m' flag is given
  789.      the arguments are taken as patterns (should be quoted) and all
  790.      elements of the corresponding hash table with matching names will
  791.      be removed.
  792. `unlimit [ -hs ] RESOURCE ...'
  793.      The resource limit for each RESOURCE is set to the hard limit.  If
  794.      the `-h' flag is given and the shell is running as root, the hard
  795.      resource limit for each RESOURCE is removed.  The resources of the
  796.      shell process are only changed if the `-s' flag is given.
  797. `unset [ -m ] NAME ...'
  798.      Each named parameter is unset.  If the `-m' flag is set, the
  799.      arguments are taken as patterns (which should be quoted), and all
  800.      parameters with matching names are unset.
  801. `unsetopt [ -m ]  [ +-OPTIONS ] [ NAME ... ]'
  802.      Unset the options for the shell.  All options specified either with
  803.      flags or by name are unset.  If the `-m' flag is given, the
  804.      arguments are taken as patterns (which should be quoted), and all
  805.      options with names matching these patterns are unset.
  806. `vared [ -c ] [ -h ] [ -p PROMPT] [ -r RPROMPT ] NAME'
  807.      The value of the parameter NAME is loaded into the edit buffer,
  808.      and the line editor is invoked.  When the editor exits, NAME is
  809.      set to the string value returned by the editor.  If the `-c' flag
  810.      is given, the parameter is created if it doesn't already exist.
  811.      If the `-p' flag is given, PROMPT will be taken as the prompt to
  812.      display at the left and if the `-r' flag is given, the following
  813.      string gives the prompt to display at the right.  If the `-h' flag
  814.      is specified, the history can be accessed from `zle'.
  815. `wait [ JOB ... ]'
  816.      Wait for the specified jobs or processes.  If JOB is not given
  817.      then all currently active child processes are waited for.  Each
  818.      JOB can be either a job specification or the process-id of a job
  819.      in the job table.  The exit status from this command is that of
  820.      the job waited for.
  821. `whence [ -vcfpam ] NAME ...'
  822.      For each name, indicate how it would be interpreted if used as a
  823.      command name.  The `-v' flag produces a more verbose report.  The
  824.      `-c' flag prints the results in a csh-like format and takes
  825.      precedence over `-v'.  The `-f' flag causes the contents of a
  826.      shell function to be displayed, which would otherwise not happen
  827.      unless the `-c' flag were used.  The `-p' flag does a path search
  828.      for NAME even if it is an alias, reserved word, shell function or
  829.      builtin.  The `-a' flag does a search for all occurrences of NAME
  830.      throughout the command path.  With the `-m' flag, the arguments
  831.      are taken as patterns (which should be quoted), and the
  832.      information is displayed for each command matching one of these
  833.      patterns.
  834. `where'
  835.      Same as `whence -ca'.
  836. `which [ -pam ] NAME ...'
  837.      Same as `whence -c'.
  838. File: zsh.info,  Node: Programmable Completion,  Next: Concept Index,  Prev: Shell Builtin Commands,  Up: Top
  839. Programmable Completion
  840. ***********************
  841. `compctl [ -CDT ] OPTIONS [ COMMAND ... ]'
  842. `compctl [ -CDT ] OPTIONS'
  843. `        [  -x  PATTERN  OPTIONS - ... -- ] [ + OPTIONS [ -x ... -- ]
  844. ... [+] ]'
  845. `        [ COMMAND ... ]'
  846. `compctl -L [ -CDT ] [ COMMAND ... ]'
  847. `compctl + COMMAND ...'
  848. Control the editor's completion behaviour according to the supplied set
  849. of OPTIONS.  Various editing commands, notably
  850. `expand-or-complete-word', usually bound to TAB, will attempt to
  851. complete a word typed by the user, while others, notably
  852. `delete-char-or-list', usually bound to `^D' in emacs editing mode,
  853. list the possibilities; `compctl' controls what those possibilities
  854. are.  They may for example be filenames (the most common case, and
  855. hence the default), shell variables, or words from a user-specified
  856. list.
  857. * Menu:
  858. * Command Flags::
  859. * Options Flags::
  860. * Alternative Completion::
  861. * Extended Completion::
  862. * Example::
  863. File: zsh.info,  Node: Command Flags,  Next: Options Flags,  Up: Programmable Completion
  864. Command Flags
  865. =============
  866. Completion of the arguments of a command may be different for each
  867. command or may use the default.  The behaviour when completing the
  868. command word itself may also be separately specified.  These correspond
  869. to the following flags and arguments, all of which (except for `-L')
  870. may be combined with any combination of the options described
  871. subsequently in *Note Options Flags::.
  872. `COMMAND ...'
  873.      controls completion for the named commands, which must be listed
  874.      last on the command line.  If completion is attempted for a
  875.      command with a pathname containing slashes and no completion
  876.      definition is found, the  search is retried with the last pathname
  877.      component.  Note that aliases are expanded before the command name
  878.      is determined unless the `COMPLETE_ALIASES' option is set.
  879.      Commands should not be combined with the `-D', `-C' or `-T' flags.
  880.      controls default completion behaviour for commands not assigned
  881.      any special behaviour.  Without this command, filenames are
  882.      completed.
  883.      controls completion when there is no current command, in other
  884.      words when the command word itself is being completed.  Without
  885.      this command, the names of any executable command (whether in the
  886.      path or specific to the shell, such as aliases or functions) are
  887.      completed.
  888.      supplies completion flags to be used  before any other processing
  889.      is done, even those given to specific commands with other `compctl'
  890.      definitions.  This is only useful when combined with extended
  891.      completion (the `-x' flag. *Note Extended Completion::).  Using
  892.      this flag you can define default behaviour which will apply to all
  893.      commands without exception, or you can alter the standard behaviour
  894.      for all commands.  For example, if your access to the user
  895.      database is too slow  and/or it contains too many users (so that
  896.      completion after `~' is too slow to be usable), you can use
  897.      `compctl -Tx  'C[0,*/*]' -f - 's[~]' -k FRIENDS -S/'
  898.      to complete the strings in the array FRIENDS after a `~'.  The
  899.      first argument is necessary so that this form of `~'-completion is
  900.      not tried after the directory name is finished.
  901.      lists the existing completion behaviour in a manner suitable for
  902.      putting into a start-up script; the existing behaviour is not
  903.      changed.  Any combination of the above forms may be specified,
  904.      otherwise all defined completions are listed.  Any other flags
  905.      supplied are ignored.
  906. `no argument'
  907.      If no argument is given, `compctl' lists all defined completions
  908.      in an abbreviated form; with a list of OPTIONS, all completions
  909.      with those flags set (not counting extended completion) are listed.
  910.      If the `+' flag is alone and followed immediately by the COMMAND
  911.      list, the completion behaviour for all the commands in the list is
  912.      reset to its default by deleting the command from the list of
  913.      those handled specially.
  914. File: zsh.info,  Node: Options Flags,  Next: Alternative Completion,  Prev: Command Flags,  Up: Programmable Completion
  915. Options Flags
  916. =============
  917. `[ -fcFBdeaRGovNAIOPZEnbjrzu ]'
  918. `[ -k ARRAY ] [ -g GLOBSTRING ] [ -s SUBSTSTRING ]'
  919. `[ -K FUNCTION ] [ -H NUM PATTERN ]'
  920. `[ -Q ] [ -P PREFIX ] [ -S SUFFIX ]'
  921. `[ -q ] [ -X EXPLANATION ]'
  922. `[ -l CMD ] [ -U ]'
  923. The remaining options specify the type of command arguments to look for
  924. during completion.  Any combination of these flags may be specified;
  925. the result is a sorted list of all the possibilities.  The options are
  926. described in the following sections.
  927. * Menu:
  928. * Simple Flags::
  929. * Flags with arguments::
  930. * Control Flags::
  931. File: zsh.info,  Node: Simple Flags,  Next: Flags with arguments,  Up: Options Flags
  932. Simple Flags
  933. ------------
  934. These produce completion lists made up by the shell itself:
  935.      Filenames and file-system paths.
  936.      Command names, including aliases, shell functions, builtins and
  937.      reserved words.
  938.      Function names.
  939.      Names of builtin commands.
  940.      Names of external commands.
  941.      Reserved words.
  942.      Alias names.
  943.      Names of regular (non-global) aliases.
  944.      Names of global aliases.
  945.      This can be combined with `-F', `-B', `-w', `-a', `-R' and `-G' to
  946.      get names of disabled functions, builtins, reserved words or
  947.      aliases.
  948.      Without `-d' this option has no effect.  Otherwise this can be
  949.      combined with `-F', `-B', `-w', `-a', `-R' and `-G' to get names
  950.      of functions, builtins, reserved words or aliases even if they are
  951.      disabled.
  952.      Names of shell options. *Note Options::.
  953.      Names of any variable defined in the shell.
  954.      Names of scalar (non-array) parameters.
  955.      Array names.
  956.      Names of integer variables.
  957.      Names of read-only variables.
  958.      Names of parameters used by the shell (including special
  959.      parameters).
  960.      Names of shell special parameters.
  961.      Names of environment variables.
  962.      Named directories.
  963.      Key binding names.
  964.      Job names: the first word of the job leader's command line.  This
  965.      is useful with the kill builtin.
  966.      Names of running jobs.
  967.      Names of suspended jobs.
  968.      User names.
  969.